<?php
  include 'db.inc';

  //Tasks part
  function core_addTask($title,$body,$parent,$weight=1) {
    if (!DB_CONNECTED) return;
    if (!mysql_query('INSERT INTO tasks (title,body,owner,parent,weight) VALUES (\''.$title.'\',\''.$body.'\','.$_GLOBALS['user]['uid'].','.$weight.')')) return;
    return mysql_insert_id();
  } // Add new tasks

  function core_delTask($tid) {
    if (!DB_CONNECTED) return;
    return (!!mysql_query('DELETE FROM tasks WHERE tid = '.$tid));
  } // Delete task

  function core_chgTask($tid,$changes=array()) {
    
  } // Change task info $changes=array('body' => '123', 'title' => '1234')

  function core_regUser($login,$password,$nick='nick') {
    // Login field = sha1($login.'-'.$password);
  }
?>